package cn.taobaoke.restful.domain;

import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;


/**
 * RobotRepository类.
 * +-----------------------------------------------------------------------------------------------+
 * |类名称: RobotRepository                                                                         |
 * |创建时间: 3/25/17                                                                               |
 * |功能简介:                                                                                       |
 * |参考链接:                                                                                       |
 * +-----------------------------------------------------------------------------------------------+
 *
 * @author luch
 */
public interface RobotRepository extends JpaRepository<RobotEntity, Long> {

    Optional<RobotEntity> findTopOneByNameAndDomainId(String name, Long domainId);

    List<RobotEntity> findAllByDomainId(Long domainId);

    void deleteByIdAndDomainId(Long id, Long domainId);

}
